<extend name="Public/base" />
<block name="body">
<div class="m-tab s-tab">
	<h2 class="u-tt">配置管理</h2>
	<ul class="u-tabs">
		<li><a href="{:U('index')}">配置列表</a></li>
		<li><a href="#tab1" class="tab-on tab-a">{$actionName}配置</a></li>
	</ul>
</div>
<div class="m-form">
	<form action="{:U($action)}" method="post" id="form">
		<fieldset>
			<div id="tab1">
				<div class="formitm">
					<label class="lab">配置标识：</label>
					<div class="ipt">
						<input name="name" type="text" class="u-ipt u-ipt-6" id="name" value="{$info.name|default=''}" maxlength="250" datatype="*" errormsg="配置标识未填写" placeholder="用于C函数调用，只能使用英文且不能重复"/>
						<span class="suffix"></span>
						<p></p>
					</div>
				</div>
				<div class="formitm">
					<label class="lab">配置标题：</label>
					<div class="ipt">
						<input name="title" type="text" class="u-ipt u-ipt-6" id="title" value="{$info.title}" maxlength="250" datatype="*" errormsg="配置标题未填写" placeholder="用于后台显示的配置标题"/>
						<span class="suffix"></span>
						<p></p>
					</div>
				</div>
				<div class="formitm">
					<label class="lab">排序：</label>
					<div class="ipt">
						<input name="sort" type="text" class="u-ipt u-ipt-2" id="sort" value="{$info.sort|default=0}" maxlength="3" datatype="n" errormsg="排序未填写" placeholder="用于后台显示的配置标题"/>
						<span class="suffix"></span>
						<p></p>
					</div>
				</div>
				<div class="formitm">
					<label class="lab">配置类型：</label>
					<div class="ipt">
						<select class="u-slt" name="type">
							<volist name="Think.config.CONFIG_TYPE_LIST" id="type">
								<option value="{$key}">{$type}</option>
							</volist>
						</select>
						<span class="suffix">系统会根据不同类型解析配置值</span>
						<p></p>
					</div>
				</div>
				<div class="formitm">
					<label class="lab">配置分组：</label>
					<div class="ipt">
						<select class="u-slt" name="group">
							<option value="0">不分组</option>
							<volist name="Think.config.CONFIG_GROUP_LIST" id="group">
								<option value="{$key}">{$group}</option>
							</volist>
						</select>
						<span class="suffix">配置分组 用于批量设置 不分组则不会显示在系统设置中</span>
						<p></p>
					</div>
				</div>
				<div class="formitm">
					<label class="lab" >配置值：</label>
					<div class="ipt">
						<textarea name="value" id="value" class="u-tta u-tta-6" placeholder="配置值">{$info.value|default=''}</textarea>
						<span class="suffix">配置值</span>
					</div>
				</div>
				<div class="formitm">
					<label class="lab" >配置项：</label>
					<div class="ipt">
						<textarea name="extra" id="extra" class="u-tta u-tta-6" placeholder="如果是枚举型 需要配置该项">{$info.extra|default=''}</textarea>
						<span class="suffix">如果是枚举型 需要配置该项</span>
					</div>
				</div>
				<div class="formitm">
					<label class="lab" >说明：</label>
					<div class="ipt">
						<textarea name="remark" id="remark" class="u-tta u-tta-6" placeholder="配置详细说明">{$info.remark|default=''}</textarea>
						<span class="suffix">配置详细说明</span>
					</div>
				</div>


				<div class="formitm">
					<label class="lab">状态：</label>
					<div class="ipt">
						<?php if(!isset($info['status'])){ $info['status']=1; } ?>
						<select class="u-slt" name="status">
							<option <if condition="$info['status']==1">selected="selected"</if> value="1">启用</option>
							<option <if condition="$info['status']==0">selected="selected"</if> value="0">禁用</option>
						</select>
					</div>
				</div>
			</div>
			<div class="formitm formitm-1 formitm-2">
				<input type="hidden" name="id" value="{$info.id|default=''}">
				<button class="u-btn" type="submit">保存</button>
				<button class="u-btn s-btn-c3" type="reset">重置</button>
				<span class="status" id="status"></span>
			</div>
		</fieldset>
	</form>
</div>
</block>
<block name="script">
<script>
Do.ready('base','form','dialog','sort','upload','calendar','tabs',function() {


    /* 设置表单的值 */
    setValue("type", {$info.type|default=0});
    setValue("group", {$info.group|default=0});

	//表单综合处理
	$('#form').duxFormPage({
		returnUrl:"{:U('index')}",
	});

});
</script>
</block>